package home_8_18;

import java.util.Scanner;

public class Main{
    public static void main(String[] args) {
        Scanner n1 = new Scanner(System.in);
        System.out.println("1加法");
        System.out.println("2除法");
        int  n = n1.nextInt();
        JiSuanQi qqq = null;
        switch (n){
            case 1:
                qqq = new JiaFa();
                break;
            case 2:
                qqq = new ChuFa();
                break;
            default:
                throw new IllegalStateException("Unexpected value: " + n);
        }
        System.out.println("输入num1");
        int x = n1.nextInt();
        System.out.println("输入num2");
        int y = n1.nextInt();
        qqq.setNum1(x);
        qqq.setNum2(y);
        int r = qqq.jisuan();
        System.out.println(r);

    }


}
